<template>
    <view class="nova-column">
        <text class="li-section">问题类型</text>
        <view class="nova-list">
            <nova-pref v-for="(item, index) in helps" :key="index" class="li-pref" :title="item.help_type" :arrow="true" @click.native="goDetail(item)">
                <!-- <image class="profile" :src="info.photo"></image> -->
            </nova-pref>
        </view>
        <text class="li-section">意见反馈</text>
        <view class="nova-list">
            <nova-pref v-for="(item, index) in feedbacks" :key="index" class="li-pref" :title="item.help_type" :arrow="true" @click.native="goFeedback(item)">
                <!-- <image class="profile" :src="info.photo"></image> -->
            </nova-pref>
        </view>
    </view>
</template>

<script>
import novaPref from '../../components/nova/pref.vue';
export default {
    components: {
        novaPref
    },
    data() {
        return {
            helps: [],
            feedbacks: []
        };
    },
    methods: {
        async loadData() {
            let res = await this.$request.post({
                url: '/help/helpList'
            });
            this.helps = res.helps || [];
            this.feedbacks = res.feedbacks || []
        },
        goDetail(item) {
            uni.navigateTo({
                url: 'p-help-answer?id=' + item.help_type_id
            });
        },
        goFeedback(item) {
            uni.navigateTo({
                url: 'p-feedback?id=' + item.help_type_id + '&title=' + item.help_type
            });
        }
    },
    onLoad() {
        this.loadData();
    }
};
</script>

<style></style>
